<extend name="Layout/ins_page" />

<block name="head"></block>
<block name="js"></block>

<block name="content">
    <!--content begin-->
    <link rel="stylesheet" type="text/css" href="/Public/Scripts/Report/ProfitReportX/jquery/datepickup/tcal.css" />
    <script type="text/javascript" src="/Public/Scripts/Report/ProfitReportX/jquery/datepickup/tcal.js"></script>
    <style type="text/css">
        table
        {
            border-collapse:collapse; width:60%
        }
        table, td, th
        {
            border:1px solid black;
        }
        td{width:10%}
    </style>

    <form id="form1" name="form1" method="post" action="/Report/profitreportxdata/">
        选择客户平台<br />
        <?php
$sqlserver='192.168.1.10';
$sqldatabase='GT';
$sqluser='sa2';
$sqlpassword='sasa';
$sqlconnection = odbc_connect("Driver={SQL Server};Server=$sqlserver;Database=$sqldatabase;", $sqluser, $sqlpassword);
// 以上是连接信息

$sqlquery="select department from dbo.[AX_Reportwebuser] where userid='".$userid[0]."'";
$result=odbc_do($sqlconnection,$sqlquery);
while(odbc_fetch_row($result)) {
  $department = odbc_result($result, 1);
}
//if ($department=='Products') {require "departmentpage/products.html" ;}
$sqlquery="select CardCode U_BPcode,ShortName Name from AX_ChannelList";
$result=odbc_do($sqlconnection,$sqlquery);
$maxi= odbc_num_rows($result);
$options=array();
while($row=odbc_fetch_row($result)){
    $options[] = array(iconv ("gb2312","utf-8",odbc_result($result, 1)),odbc_result($result, 2));
}
//var_dump($options);die();
?>


        <select name="Cardcode[]"style="width:190px;" size="10"  multiple  <a href=# title="（按Ctrl、shift可以多选）"></a>
        <?php
for ($i=0; $i<$maxi; $i++) {
 echo "<option  selected = selected  value ='".$options[$i][0]."'>".iconv ("gb2312","utf-8",$options[$i][1])."</option>";
        }
        ?>
        </select>
        <div>
            开始时间<br />
            <input type="text" name="FromDate" class="tcal" value='<?php echo date("m/",time())."01".date("/Y",time());  $BeginDate=date('Y-m-01', strtotime(date("Y-m-d")));?>' /></div>
        <div>
            结束时间<br />
            <input type="text" name="ToDate" class="tcal" value='<?php echo date('m/d/Y', strtotime("$BeginDate +1 month -1 day")); ?>' /></div>
        显示选项<br />
        <input type="radio" name="ViewOption" checked="true" value="Total" />
        合并显示
        <input type="radio" name="ViewOption" value="Everyone" />
        分别显示
        <br />
        <div><input type="submit" name="Submit" value="提交" /></div>

    </form>

    <!--content end-->
</block>